package processor.procurement;

import model.payment.Payment;
import model.procurement.ProcurementContent;
import model.user.User;
import processor.operator.OperatorLog;

public class ProcurementPage implements OperatorLog {
    private User user;
    private Payment payment;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Payment getPayment() {
        return payment;
    }

    public void setPayment(Payment payment) {
        this.payment = payment;
    }

    public String buildOperator(User user, Payment payment, ProcurementContent procurementContent, String currentPageName) {
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(user.getUserName());
        stringBuffer.append("在");
        stringBuffer.append(currentPageName);
        stringBuffer.append("使用");
        stringBuffer.append(payment.getPaymentAction().paymentType());
        stringBuffer.append(payment.getPaymentAction().transactionType());
        stringBuffer.append("了");
        stringBuffer.append(procurementContent.getGoodsNumber());
        stringBuffer.append(procurementContent.getGoodsName());
        stringBuffer.append("，");
        stringBuffer.append(payment.getPaymentAction().paymentMethod());
        stringBuffer.append(payment.getConsumptionAmount());
        stringBuffer.append(payment.getPaymentAction().paymentUnit());
        return stringBuffer.toString();
    }
}
